<?php
class Contact extends AppModel {
	var $name = 'Contact';
	var $useTable = 'contacts';
	var $primaryKey = 'id';
	var $displayField = 'name';
	var $validate = array(
		'name' => array(
			'rule' => array('between', 1, 100),
			'required' => true,
			'message' => Messages::contact_name_must_be_between_1_and_100_characters_long,
		),
		'email' => array(
			'length' => array(
				'rule' => array('between', 1, 200),
				'required' => true,
				'message' => Messages::contact_email_must_be_between_1_and_200_characters_long,
			),
			'email' => array(
				'rule' => array('email', true),
				'message' => Messages::invalid_email_address,
			)
		),
		'type' => array(
			'rule' => 'notEmpty',
			'required' => true,
			'message' => Messages::contact_type_is_required,
		),
		'content' => array(
			'rule' => 'notEmpty',
			'required' =>  true,
			'message' => Messages::contact_content_is_required,
		)
	);
}